UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eBA8LQAmBi2N3GdtE9UUFeQeTIFoVHp7PFjmf6Ugn8k='
WHERE
key_id = '163dc8c776e9c098060a246852c05720c54cff395f1a6be6417e9d2d1403e842'
AND (
token = 'eBA8LQAmBi2N3GdtE9UUFeQeTIFoVHp7PFjmf6Ugn8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)