UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pN3/VW1C4i10wqWddPhve3YNVmkx1zyqalOcgnYtwB0='
WHERE
key_id = '4a41adda7d4f3afa86e0f04f089aef83f7f5eb6a6352e8a026f82a432555ecc2'
AND (
token = 'pN3/VW1C4i10wqWddPhve3YNVmkx1zyqalOcgnYtwB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)