UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5cyoCCB5XeTg0L9edno8VRM0oN6drKhTM2uj7RBdxkk='
WHERE
key_id = '7ed537bbee800331d7d448d90993ab318e99d47544efc44a22b370cd036d2d93'
AND (
token = '5cyoCCB5XeTg0L9edno8VRM0oN6drKhTM2uj7RBdxkk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)