UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hs+XFK3H1lWbrTeModEdL0+N76EIxavKUQtdEiG5890='
WHERE
key_id = '76213d898a2623620368bc64d5d2d1130cbb47784401a8920799e083f6d0b2dc'
AND (
token = 'hs+XFK3H1lWbrTeModEdL0+N76EIxavKUQtdEiG5890='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)