UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xjyb2dKhWcARVcJX1Q2HE58/DPiQ2SEJNcoHWvAWJ8s='
WHERE
key_id = '5627ff639fb65058a25fabfee4cfa1571871c4706673fdeadb25e20d3c80f21a'
AND (
token = 'Xjyb2dKhWcARVcJX1Q2HE58/DPiQ2SEJNcoHWvAWJ8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)