UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k/6VgcjPaaj7VFNlr+bDV/i6IBM8uyuATl9xcUoTZjE='
WHERE
key_id = 'be08f53ac913d8c1271c3ddff812184ff99f44cc806ea564dae9dd15f9a3493e'
AND (
token = 'k/6VgcjPaaj7VFNlr+bDV/i6IBM8uyuATl9xcUoTZjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)