UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's0wUhlYPk9YPLP6dOQwSBSIY1JTDU0yykE3c7ULdOyI='
WHERE
key_id = '34206c6dd8c3e87f151268da18ef3880fae0268d37a139d075cbaefd48baffb5'
AND (
token = 's0wUhlYPk9YPLP6dOQwSBSIY1JTDU0yykE3c7ULdOyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)