UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FksVKsv3FjcCwNmlC7eHv3JBeLyRYIPkI0YHwbU4tMo='
WHERE
key_id = '290a7007be7ab13d695d1b72801b1ee048c0eb63b895e743b04867bd648fcd34'
AND (
token = 'FksVKsv3FjcCwNmlC7eHv3JBeLyRYIPkI0YHwbU4tMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)