UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3U9srxwjuhQEA9IAe5om8j/JgzSMbLaeaCzmlyourWY='
WHERE
key_id = '76db59ce3118a1d5282c61f87afdda8db94b535d2f6739b065251e85d94cf817'
AND (
token = '3U9srxwjuhQEA9IAe5om8j/JgzSMbLaeaCzmlyourWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)