UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gSeH1YIR3u6yByjkt546fzpWU0TRaftmaBd4/+jKsEo='
WHERE
key_id = '311d728a57f16622337eb8dcdbf32aa22017322b2ca3aae2d508853a5048e6e0'
AND (
token = 'gSeH1YIR3u6yByjkt546fzpWU0TRaftmaBd4/+jKsEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)