UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pQf3xjj4C6MZbWa5f3QhkdHoFPbzZD1jp92CWsnlUnA='
WHERE
key_id = 'e1791209d052d30ee66d699cebe2368f9d623486ef444e4f0adb9c9d3af5e48c'
AND (
token = 'pQf3xjj4C6MZbWa5f3QhkdHoFPbzZD1jp92CWsnlUnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)