UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y2XtO6cBXY6tpXN0Er4fvMZSeb5L81Xj9G1CheTf2v8='
WHERE
key_id = '6e3a6ee0597811a90657f25524a5aa007780eeec1eec8ae6dfb8dfb407052308'
AND (
token = 'y2XtO6cBXY6tpXN0Er4fvMZSeb5L81Xj9G1CheTf2v8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)