UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JLH5oZzo1cI+neavlKINV6a6ALDPhDqIlUEBhLUCmJE='
WHERE
key_id = 'a22327de9fa2ed2470a3130e14d50562eccfb69bad1c5f081f408f521137c911'
AND (
token = 'JLH5oZzo1cI+neavlKINV6a6ALDPhDqIlUEBhLUCmJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)