UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L90un3EEvKwrMO64qUE7ykDjtJrO9zWvy+BPinFzY8o='
WHERE
key_id = '2d9f14e901922f6cfa52723d2955072726a4bead9514b3712bdc1867660a38be'
AND (
token = 'L90un3EEvKwrMO64qUE7ykDjtJrO9zWvy+BPinFzY8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)