UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MwLUiwGVuEpuHKwjbK+eMvG9psQOCVTAWVwWxL8CO6M='
WHERE
key_id = '2dbdeb542237bef9aa140aba0f8a25aadb2e26ff7076b49ed38ac8c550aca389'
AND (
token = 'MwLUiwGVuEpuHKwjbK+eMvG9psQOCVTAWVwWxL8CO6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)