UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xWPl95B+MQ9TP0uyslR5Dw5xoRg0sFlAwSVqu6AexkA='
WHERE
key_id = '44bd520b5fe71ae1dd84009c015eea34b6379722b37c7db73fd50ced0c71e5f5'
AND (
token = 'xWPl95B+MQ9TP0uyslR5Dw5xoRg0sFlAwSVqu6AexkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)