UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EypKyYKta4zrFczitfEF7knG+Z7BhfrgFM5Takz4Ov0='
WHERE
key_id = '48230f0ee2583c6ba0fda3222bfa92555c8fce10ee8565642092e40741644215'
AND (
token = 'EypKyYKta4zrFczitfEF7knG+Z7BhfrgFM5Takz4Ov0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)