UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8unf1rWp2uxoblxVlDTGpkcdp0sRvrgxH76LR7u20dk='
WHERE
key_id = '4ac781e74b6975e6a070629ee6ce7fb90fef51da038360b6eb60704266dae12c'
AND (
token = '8unf1rWp2uxoblxVlDTGpkcdp0sRvrgxH76LR7u20dk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)