UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kB9dKDn4Olzi2vHVV17PZHCy/i3pXX672QTjcRaDxkM='
WHERE
key_id = 'e0353ba9152b7261ca09c8abafb1197ae7243a3bf34419dcebb94c8bd2b074b5'
AND (
token = 'kB9dKDn4Olzi2vHVV17PZHCy/i3pXX672QTjcRaDxkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)