UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6G0zmlJl3n8PwAqRxUe38szyLN6dHgDBkitkFrV7Ytw='
WHERE
key_id = '4453bdb5762dc09a817289df37d13acbde7231a44e90a4d60bc40c09a32950fe'
AND (
token = '6G0zmlJl3n8PwAqRxUe38szyLN6dHgDBkitkFrV7Ytw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)