UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fH3WrVlvquCNb7SENI5jJuC+QTeBojSbng5qAeN05hM='
WHERE
key_id = '682ae590ac939258915dae12491a40550ef33a4c57f63338610db9f7b8a1e040'
AND (
token = 'fH3WrVlvquCNb7SENI5jJuC+QTeBojSbng5qAeN05hM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)