UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nj+4bV3zepM7agWgow5y/33rrjdxl1fBKHNEzdXH2Es='
WHERE
key_id = 'ef809eff8ea5356499857cd99c4848b095e54e5a6bb955cf119718c1ebf8b522'
AND (
token = 'nj+4bV3zepM7agWgow5y/33rrjdxl1fBKHNEzdXH2Es='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)