UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QUBFNI0GP5dPuuzh5q7OU7g7RvHmmeTgeT5sYBIn/Wg=' 
WHERE 
  key_id = '89f61a10449768d89bff21abe81505cf68ca4b31a19ebfcc8dc9a61fffb1070f' 
  AND (
    token = 'QUBFNI0GP5dPuuzh5q7OU7g7RvHmmeTgeT5sYBIn/Wg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043