UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y2HtD3ZXu/wHT7lkARj6SrrbL/EjW4Kl/+QRZADr854=' 
WHERE 
  key_id = '45bf7da876e6b8ef1ea6449aa3516c599f8472644d8b85ed85f6fa95b15f6ae9' 
  AND (
    token = 'Y2HtD3ZXu/wHT7lkARj6SrrbL/EjW4Kl/+QRZADr854=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033