UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EhDkKIBF4LlQlmdF2kruv+2SqrIEq/bCJTMFbpiJJEo='
WHERE
key_id = 'ed2de8af09011e38151390ef0c3fc22db6cdc5dd65c8cc29815650584fb631df'
AND (
token = 'EhDkKIBF4LlQlmdF2kruv+2SqrIEq/bCJTMFbpiJJEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)