UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2D5caEEc/mGU4ry9WhxCBITFR2e827DXSelHqJvPHDQ='
WHERE
key_id = 'd528a5d9a67560e319458a31609e2b1f2047bb1c428f1392e0f62fe5d9bf9e53'
AND (
token = '2D5caEEc/mGU4ry9WhxCBITFR2e827DXSelHqJvPHDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)