UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A7MmEgDnlDwdZCpbHIWXGmh0cVhYQh1rpK7ahajzNQE='
WHERE
key_id = '4576934c600c53848a2015f837ef4e1deb566abc9e05817797a1786efbeb3ed5'
AND (
token = 'A7MmEgDnlDwdZCpbHIWXGmh0cVhYQh1rpK7ahajzNQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)